package cn.fxl.feign;

import cn.fxl.ajax.AjaxResult;
import cn.fxl.domain.MoveUser;
import cn.fxl.domain.Movie;
import cn.fxl.hystrix.MovieHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "movie-server",fallbackFactory = MovieHystrix.class)
public interface MovieFeign {
    @GetMapping("/movie/getAll")
    List<Movie> movieGetAll();

    @GetMapping("/getOne/{id}")
    Movie getOne(@PathVariable("id") Long id);

    @GetMapping("/move/getOne/{id}")
    AjaxResult moveGetOne(@PathVariable("id") Long id);

    @PostMapping("/moveUser/update")
    AjaxResult update(MoveUser moveUser);

    @PostMapping("/saveAdd")
     AjaxResult saveAdd(@RequestBody MoveUser moveUser);

    @PostMapping("/UpdateByMovie")
     AjaxResult UpdateByMovie(@RequestBody Movie movie);
}
